﻿using System;
using System.Collections.Generic;
using System.Data;
using MigSharp;

namespace CmsDatabaseMigrations.Migrations
{
    [MigrationExport(ModuleName = "Users", Tag = "Language")]
    public class UserLanguage201505210005 : BatchMigration
    {
        protected override IEnumerable<string> SpFileNames
        {
            get
            {
                yield return "cms_sp_CreateUser201505210005.sql";
                yield return "cms_sp_UpdateUser201505210005.sql";
                yield return "cms_sp_GetUserForManagement201505210005.sql";                
                yield return "cms_sp_GetUsersForManagement201505210005.sql";
                yield return "cms_sp_UserGetByEmail201505210005.sql";
                yield return "cms_sp_GetUserAndUserGroups201505210005.sql";                
            }
        }

        protected override IEnumerable<Action<IDatabase>> UpActions
        {
            get
            {
                yield return a => a.Tables["Users"].AddNullableColumn("Locale", DbType.String).OfSize(50);
            }
        }

        protected override IEnumerable<Action<IDatabase>> DownActions
        {
            get { return new List<Action<IDatabase>>(); }
        }
    }
}